<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  	<head>
        <title>P2P Fusion - Peerscape</title>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
        <meta name="generator" content="Peerscape" />
        <meta http-equiv="imagetoolbar" content="no" />

        <style type="text/css">
            <!-- 
            @import url(/static/css/core.css);
            @import url(/static/css/content.css);
            -->
        </style>
        <link rel="shortcut icon" type="image/x-icon" href="http://p2p-fusion.org/favicon.ico" />
    </head>
  	<body class="admin">
	    <div id="wrapper">
	        <div id="inner">
                <div id="topLinks">
                    <h5 class="hide">Personal tools</h5>
                    <ul>
                        <li>
                            <a id="admin" href="http://admin.hexlabel.net/">My Admin</a>
                        </li>
                        <li>
                            <a id="user" href="http://my.hexlabel.net/">My Profile</a>
                        </li>
                    </ul>
                    <div class="clr"><br/></div>
                </div>

                <div id="main">
                    <div class="inner" style="border: 2px solid ${safety_color}">
                        <div id="header">
                            <div class="left">
                                <h1 id="logo"><a href="http://my.hexlabel.net/" accesskey="1">fusion</a></h1>
                                <h2 id="subtitle">Peerscape</h2>
                            </div>
                            <div class="right">
                                <div id="globalTools">
                                    <h5 class="hide">Global tools</h5>
                                    <ul class="contextTools">
                                        <li class="selected">
                                            <a href="http://admin.hexlabel.net/">Admin Home</a>
                                        </li>
                                        <li>
                                            <a href="http://admin.hexlabel.net/invite_person/">Invite a friend</a>
                                        </li>
                                        <li>
                                            <a href="http://admin.hexlabel.net/invite_group_list/">Invite someone to join a group</a>
                                        </li>
                                        <li>
                                            <a href="http://admin.hexlabel.net/invitations/">Invitations</a>
                                        </li>
                                        <li>
                                            <a href="http://admin.hexlabel.net/personal_code/">Create login</a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                            <div class="clr"><br/></div>
                        </div>

                        <div id="content">
                            <div id="info">
                                <h2>Browse data</h2>
                                <div class="intro">
                                    <p>Browse the data that is currently stored on your computer.</p>
                                </div>

                                <%def name="procLIST(iid, l)">
                                    <ul>
                                        %for v in l:
                                            <li>
                                                % if type(v) == type(dict()):
                                                    ${procDICT(iid, v, no_links=True)}
                                                % elif type(v) == type(list()):
                                                    ${procLIST(iid, v)}
                                                % else:
                                                    ${v}
                                                % endif
                                            </li>
                                        %endfor
                                    </ul>
                                </%def>
                                <%def name="procDICT(iid, d, no_links=False)">
                                    <ul>
                                        %for k, v in d.items():
                                            <li>
                                                % if type(v) == type(dict()):
                                                    <h4>${k}</h4>
                                                    ${procDICT(iid, v, no_links=True)}
                                                % elif type(v) == type(list()):
                                                    <h4>${k}</h4>
                                                    ${procLIST(iid, v)}
                                                % else:
                                                    % if v:
                                                        % if no_links:
                                                            <h4>${k}</h4>
                                                            ${v}
                                                        % else:
                                                            <h4><a href="http://${iid}.hexlabel.net/content/${k}">${k}</a></h4>
                                                                % if v:
                                                                    <h4><a href="http://${iid}.hexlabel.net/content/${k}">${k}</a></h4>
                                                                    ${v}
                                                                % else:
                                                                    <h4>${k}</h4>
                                                                    None
                                                                % endif
                                                        % endif
                                                    % else:
                                                        <h4>${k}</h4>
                                                        None
                                                    % endif
                                                % endif
                                            </li>
                                        %endfor
                                    </ul>
                                </%def>
                                <div id="dataBrowser">
                                    <h3>Person</h3>
                                    <ul id="person">
                                    % for iid, ds in dataset_list['principal'].items():
                                        <li id="${iid}">
                                            <a href="http://admin.hexlabel.net/browse_db/${iid}#${iid}">${ds['name']}</a>
                                            <div class="meta">touched: ${ds['info']['touched']}, size: ${ds['info']['size']}</div>
                                            % if dataset_iid and dataset_iid == iid:
                                                <ul>
                                                    <li>
                                                        INFO: ${procDICT(iid, dataset['info'], no_links=True)}
                                                    </li>
                                                    <li>
                                                        DATA
                                                        <ul>
                                                            % for k, v in dataset['data'].items():
                                                                <li>
                                                                    % if type(v) == type(dict()):
                                                                        <h4>${k}</h4>
                                                                        ${procDICT(iid, v, no_links=True)}
                                                                    % elif type(v) == type(list()):
                                                                        <h4>${k}</h4>
                                                                        ${procLIST(v)}
                                                                    % else:
                                                                        % if v:
                                                                            <h4><a href="http://${iid}.hexlabel.net/content/${k}">${k}</a></h4>
                                                                            ${v}
                                                                        % else:
                                                                            <h4>${k}</h4>
                                                                            None
                                                                        % endif
                                                                    % endif
                                                                </li>
                                                            % endfor
                                                            % if len(dataset['keys']) == 0:
                                                                Empty
                                                            % endif
                                                        </ul>
                                                    </li>
                                                </ul>
                                            % endif
                                        </li>
                                    % endfor
                                    </ul>

                                    <h3>Group</h3>
                                    <ul id="group">
                                    % for iid, ds in dataset_list['group'].items():
                                        <li id="${iid}">
                                            <a href="http://admin.hexlabel.net/browse_db/${iid}#${iid}">${ds['name']}</a>
                                            <div class="meta">touched: ${ds['info']['touched']}, size: ${ds['info']['size']}</div>
                                            % if dataset_iid and dataset_iid == iid:
                                                <ul>
                                                    <li>
                                                        INFO: ${procDICT(iid, dataset['info'], no_links=True)}
                                                    </li>
                                                    <li>
                                                        DATA
                                                        <ul>
                                                            % for k, v in dataset['data'].items():
                                                                <li>
                                                                    % if type(v) == type(dict()):
                                                                        <h4>${k}</h4>
                                                                        ${procDICT(iid, v, no_links=True)}
                                                                    % elif type(v) == type(list()):
                                                                        <h4>${k}</h4>
                                                                        ${procLIST(v)}
                                                                    % else:
                                                                        % if v:
                                                                            <h4><a href="http://${iid}.hexlabel.net/content/${k}">${k}</a></h4>
                                                                            ${v}
                                                                        % else:
                                                                            <h4>${k}</h4>
                                                                            None
                                                                        % endif
                                                                    % endif
                                                                </li>
                                                            % endfor
                                                            % if len(dataset['keys']) == 0:
                                                                Empty
                                                            % endif
                                                        </ul>
                                                    </li>
                                                </ul>
                                            % endif
                                        </li>
                                    % endfor
                                    </ul>

                                    <h3>Content</h3>
                                    <ul id="mycontent">
                                    % for iid, ds in dataset_list['content'].items():
                                        <li id="${iid}">
                                            <a href="http://admin.hexlabel.net/browse_db/${iid}#${iid}">${ds['name']}</a>
                                            <div class="meta">touched: ${ds['info']['touched']}, size: ${ds['info']['size']}</div>
                                            % if dataset_iid and dataset_iid == iid:
                                                <ul>
                                                    <li>
                                                        INFO: ${procDICT(iid, dataset['info'], no_links=True)}
                                                    </li>
                                                    <li>
                                                        DATA
                                                        <ul>
                                                            % for k, v in dataset['data'].items():
                                                                <li>
                                                                    % if type(v) == type(dict()):
                                                                        <h4>${k}</h4>
                                                                        ${procDICT(iid, v, no_links=True)}
                                                                    % elif type(v) == type(list()):
                                                                        <h4>${k}</h4>
                                                                        ${procLIST(v)}
                                                                    % else:
                                                                        % if v:
                                                                            <h4><a href="http://${iid}.hexlabel.net/content/${k}">${k}</a></h4>
                                                                            ${v}
                                                                        % else:
                                                                            <h4>${k}</h4>
                                                                            None
                                                                        % endif
                                                                    % endif
                                                                </li>
                                                            % endfor
                                                            % if len(dataset['keys']) == 0:
                                                                Empty
                                                            % endif
                                                        </ul>
                                                    </li>
                                                </ul>
                                            % endif
                                        </li>
                                    % endfor
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
    
                <div id="footer">
                    <div class="left">
                        <ul>
                            <li><a class="footer" href="http://p2p-fusion.org">Home</a></li>
                            <li><a class="footer" href="http://p2p-fusion.org/contact">Contact us</a></li>
                            <li><a class="footer" href="http://p2p-fusion.org/disclaimer">Disclaimer</a></li>
                        </ul>
                    </div>
                    <div class="right">
                        <p class="footerText">P2P-FUSION is co-funded by the European Union through the IST programme under FP6.</p>
                    </div>
                    <div class="clr"><br/></div>
                </div>
            </div>
	    </div>
	</body>
</html>


